<?php
  require_once('tpl/header.php');
   require_once("loginCheckadmin.php");
      require_once("../system/dbConn.php");
   $gid=$_GET["gid"];
   
    $sql="select * from goods where gid=$gid";
    $result=mysqli_query($link,$sql);

    $row=mysqli_fetch_assoc($result);//$row
    // echo $row["type"];
?><form class="form-horizontal" action="doGoodsUpdate.php" method="post" enctype="multipart/form-data">
    <input type="hidden" name="gid" value="<?php echo $gid; ?>">
		商品名：
			<input type="text" name="gname" value= "<?php echo $row["gname"]; ?>">
		<br>
    <br>
	类  型： &nbsp&nbsp<select  name="type">
                <option value="0" <?php if ($row["type"]==0) {
                  echo "selected";
                  # code...
                } ?>>生活用品</option>
                    <option value="1" <?php if ($row["type"]==1) {
                  echo "selected";
                  # code...
                } ?>>电子产品</option>
                    <option value="2" <?php if ($row["type"]==2) {
                  echo "selected";
                  # code...
                } ?>>学习资料</option>
                    <option value="3" <?php if ($row["type"]==3) {
                  echo "selected";
                  # code...
                } ?>>其他</option>
            </select>
            <br>
            <br>

    <input type="file" name="pic">
          原图片:<img  src="../images/<?php echo $row["pic"]; ?>" width="100" height="100" alt="">
           <br>
           <br>
            价格：
      <input type="text" name="price" value= "<?php echo $row["price"]; ?>">
    <br>
    <br>

      电话：
      <input type="text" name="phone" value= "<?php echo $row["phone"]; ?>">
   
     <br>
    <br>
	    详情：
        <br>
            &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<textarea rows="7"  cols="60" name="detial"    > <?php echo $row["detial"]; ?> </textarea>
        <br>
        <br>
        <input type="submit"  onclick="return confirm('确认修改吗?')" value="修改">
<?php
  require_once('tpl/footer.php');
?>